<?php 
require 'dbconnect.php';
session_start();
if(isset($_SESSION['access'])){
$page = ($_SESSION['access'] == 0) ? 'studentmasterpage.php' : 'facultymasterpage.php';
include $page;
}
else{
echo $_SESSION['name'];
echo $_SESSION['access'];
echo "the session isnt working";
}
$myid = $_SESSION['id'];
$csid = $_GET['id'];
echo "<table border = '5'><tr><td>Student Name</td><td>Grade</td></tr>";
$result = mysql_query("Select S.StudentName, SC.Grade FROM Student S, StudentCourse SC WHERE S.StudentID = SC.StudentID AND SC.CourseScheduleID = '$csid'") or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
}
echo "</table>";
include 'footer.php';

?>